package concurrency;

public class Factorial {

	private int n;
	 
    public Factorial(int n) {
        this.n = n;
    }
 
    public Integer call() {
        int result = 1;
 
        for (int i = 1; i <= n; i++) {
            result = result * i;
        }
 
        try {
            Thread.sleep(5000);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
        
        System.out.println("currentThread = " + Thread.currentThread().getName());
        return result;
    }

}
